<html>

<head>
<title>Update</title>
<link type="text/css" href="jquery-ui-1.8.14.custom/css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="Stylesheet" />	
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.14.custom/js/jquery-ui-1.8.14.custom.min.js"></script>
</head>
<body>

<br/>
<br/>
<center><h1>Update PRESCRIPTIONS</h1></center>
<br/>
<center><table border=3 bordercolor="#ff99cc">
<tr><td>

<?
	$conn = oci_connect("hospital", "hospital", "//localhost/XE"); 
	$call = "select * from prescription where pre_id = '".$_GET["ids"]."' ";
	$col = $_GET["ids"];
	$pull = oci_parse($conn,$call);
	oci_execute($pull,OCI_DEFAULT);
	$total = oci_fetch_array($pull);
?>
<script language="javascript">
function fncSubmit()
{
if(document.form1.pre_id.value == "")
	{
	alert('Please input PRESCRIPTTION ID');
		document.form1.pre_id.focus();
		return false;
	}
if(document.form1.ph_id.value == "")
	{
		alert('Please input PHAMACY ID');
		document.form1.ph_id.focus();
		return false;
	}
  
if(document.form1.med_id.value == "")
	{
		alert('Please input MEDICATION ID');
		document.form1.med_id.focus();       
		return false;
	}
if(document.form1.pa_id.value == "")
	{
		alert('Please input PATIENT ID');
		document.form1.pa_id.focus();       
		return false;
	}
	document.form1.submit();
}

</script>

<form name="form1" method="post" action="edit-prescription.php?col=+<?echo $col?>" name="form1" onSubmit="JavaScript:return fncSubmit();">
	PRESCRIPTTION ID: <input name="pre_id" type="text" value = "<?=$total["PRE_ID"];?>"/><br/>
        PHAMACY ID: <input name="ph_id" type="text" value = "<?=$total["PHAMA_ID"];?>"/><br/>
	MEDICATION ID: <input name="med_id" type="text" value = "<?=$total["MED_ID"];?>"/><br/>
        PATIENT ID: <input name="pa_id" type="text" value = "<?=$total["PATIENT_ID"];?>"/><br/>
	<center><input type="submit" /></center>
</form>
</td></tr>
</table>


</body>
</html>